import { z } from "zod";

import { definePlugin } from "@/__registries__/plugins/utils";

declare module "@/__registries__/plugins/meta.types" {
  interface PluginsSettingsRegistry {
    "comet:isolatedZoom": z.infer<typeof schema>;
  }
}

const schema = z.object({
  enabled: z.boolean(),
  zoomLevel: z.number().min(0.25).max(5).prefault(1),
});

export default definePlugin({
  meta: {
    id: "comet:isolatedZoom",
    title: "Comet: Isolated Zoom",
    description:
      "Enable interface zoom on Comet Assistant without affecting the main page",
    dashboardMeta: {
      tags: ["ui", "cometAssistant", "cometAssistantOnly"],
      categories: ["comet"],
      uiRouteSegment: "comet-isolated-zoom",
    },
  },
  settingsSchema: {
    schema,
    fallback: {
      enabled: false,
      zoomLevel: 1,
    },
  },
});
